import request from "@/utils/request";
import {UserForm, UserPageVO, UserQuery} from "./model";

class UserAPI {
    /**
     * 登录成功后获取用户信息（昵称、头像、权限集合和角色集合）
     */
    static getInfo(userId: number) {
        return request<any, UserForm>({
            url: "/api/user/" + userId,
            method: "get",
        });
    }

    /**
     * 获取用户分页列表
     *
     * @param queryParams
     */
    static getPage(queryParams: UserQuery) {
        return request<any, PageResult<UserPageVO>>({
            url: "/api/user/list",
            method: "get",
            params: queryParams,
        });
    }
}

export default UserAPI;
